3.1.30 \(\int (c+d x) \csc ^2(a+b x) \, dx\) [30]

Optimal. Leaf size=29 \[ -\frac {(c+d x) \cot (a+b x)}{b}+\frac {d \log (\sin (a+b x))}{b^2} \]

[Out]

-(d*x+c)*cot(b*x+a)/b+d*ln(sin(b*x+a))/b^2

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4269, 3556} \begin {gather*} \frac {d \log (\sin (a+b x))}{b^2}-\frac {(c+d x) \cot (a+b x)}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)*Csc[a + b*x]^2,x]

[Out]

-(((c + d*x)*Cot[a + b*x])/b) + (d*Log[Sin[a + b*x]])/b^2

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int (c+d x) \csc ^2(a+b x) \, dx &=-\frac {(c+d x) \cot (a+b x)}{b}+\frac {d \int \cot (a+b x) \, dx}{b}\\ &=-\frac {(c+d x) \cot (a+b x)}{b}+\frac {d \log (\sin (a+b x))}{b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 52, normalized size = 1.79 \begin {gather*} -\frac {d x \cot (a)}{b}-\frac {c \cot (a+b x)}{b}+\frac {d \log (\sin (a+b x))}{b^2}+\frac {d x \csc (a) \csc (a+b x) \sin (b x)}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)*Csc[a + b*x]^2,x]

[Out]

-((d*x*Cot[a])/b) - (c*Cot[a + b*x])/b + (d*Log[Sin[a + b*x]])/b^2 + (d*x*Csc[a]*Csc[a + b*x]*Sin[b*x])/b

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 53, normalized size = 1.83

method result size
derivativedivides \(\frac {\frac {d a \cot \left (b x +a \right )}{b}-c \cot \left (b x +a \right )+\frac {d \left (-\left (b x +a \right ) \cot \left (b x +a \right )+\ln \left (\sin \left (b x +a \right )\right )\right )}{b}}{b}\) \(53\)
default \(\frac {\frac {d a \cot \left (b x +a \right )}{b}-c \cot \left (b x +a \right )+\frac {d \left (-\left (b x +a \right ) \cot \left (b x +a \right )+\ln \left (\sin \left (b x +a \right )\right )\right )}{b}}{b}\) \(53\)
risch \(-\frac {2 i d x}{b}-\frac {2 i d a}{b^{2}}-\frac {2 i \left (d x +c \right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )}+\frac {d \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )}{b^{2}}\) \(59\)
norman \(\frac {-\frac {c}{2 b}+\frac {c \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2 b}-\frac {d x}{2 b}+\frac {d x \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2 b}}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )}+\frac {d \ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{2}}-\frac {d \ln \left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{2}}\) \(98\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)*csc(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

1/b*(1/b*d*a*cot(b*x+a)-c*cot(b*x+a)+1/b*d*(-(b*x+a)*cot(b*x+a)+ln(sin(b*x+a))))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 217 vs. \(2 (29) = 58\).
time = 0.29, size = 217, normalized size = 7.48 \begin {gather*} \frac {\frac {{\left ({\left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + {\left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) - 4 \, {\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} d}{{\left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right )} b} - \frac {2 \, c}{\tan \left (b x + a\right )} + \frac {2 \, a d}{b \tan \left (b x + a\right )}}{2 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a)^2,x, algorithm="maxima")

[Out]

1/2*(((cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a)^2 - 2*cos(2*b*x + 2*a) + 1)*log(cos(b*x + a)^2 + sin(b*x + a)^2 +
 2*cos(b*x + a) + 1) + (cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a)^2 - 2*cos(2*b*x + 2*a) + 1)*log(cos(b*x + a)^2 +
 sin(b*x + a)^2 - 2*cos(b*x + a) + 1) - 4*(b*x + a)*sin(2*b*x + 2*a))*d/((cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a
)^2 - 2*cos(2*b*x + 2*a) + 1)*b) - 2*c/tan(b*x + a) + 2*a*d/(b*tan(b*x + a)))/b

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 46, normalized size = 1.59 \begin {gather*} \frac {d \log \left (\frac {1}{2} \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) - {\left (b d x + b c\right )} \cos \left (b x + a\right )}{b^{2} \sin \left (b x + a\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a)^2,x, algorithm="fricas")

[Out]

(d*log(1/2*sin(b*x + a))*sin(b*x + a) - (b*d*x + b*c)*cos(b*x + a))/(b^2*sin(b*x + a))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right ) \csc ^{2}{\left (a + b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a)**2,x)

[Out]

Integral((c + d*x)*csc(a + b*x)**2, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1251 vs. \(2 (29) = 58\).
time = 4.42, size = 1251, normalized size = 43.14 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a)^2,x, algorithm="giac")

[Out]

1/2*(b*d*x*tan(1/2*b*x)^2*tan(1/2*a)^2 + b*c*tan(1/2*b*x)^2*tan(1/2*a)^2 - b*d*x*tan(1/2*b*x)^2 - 4*b*d*x*tan(
1/2*b*x)*tan(1/2*a) + d*log(16*(tan(1/2*b*x)^8*tan(1/2*a)^2 + 2*tan(1/2*b*x)^7*tan(1/2*a)^3 + tan(1/2*b*x)^6*t
an(1/2*a)^4 - 2*tan(1/2*b*x)^7*tan(1/2*a) - 2*tan(1/2*b*x)^6*tan(1/2*a)^2 + 2*tan(1/2*b*x)^5*tan(1/2*a)^3 + 2*
tan(1/2*b*x)^4*tan(1/2*a)^4 + tan(1/2*b*x)^6 - 2*tan(1/2*b*x)^5*tan(1/2*a) - 6*tan(1/2*b*x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2*tan(1/2*a) + b^2*tan(1/2*b*x)*tan(1/2*a)^2 - b^2*tan(1/2*b*x) - b^2*tan(1/2*a))

________________________________________________________________________________________

Mupad [B]
time = 1.18, size = 55, normalized size = 1.90 \begin {gather*} \frac {d\,\ln \left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,2{}\mathrm {i}}-1\right )}{b^2}-\frac {\left (c+d\,x\right )\,2{}\mathrm {i}}{b\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}-1\right )}-\frac {d\,x\,2{}\mathrm {i}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)/sin(a + b*x)^2,x)

[Out]

(d*log(exp(a*2i)*exp(b*x*2i) - 1))/b^2 - ((c + d*x)*2i)/(b*(exp(a*2i + b*x*2i) - 1)) - (d*x*2i)/b

________________________________________________________________________________________